<!--
 * @Descripttion:
 * @Copyright: 武汉一一零七科技有限公司©版权所有
 * @Link: 1074699502@qq.com
 * @Contact: QQ:1074699502
 * @LastEditors: wzb
 * @LastEditTime: 2020-12-07 12:14:13
-->
<template>
<div class="liveCard" @click="linkTo(liveInfo)">
    <div class="liveStatus" v-if="liveInfo.status!==-1">
        <liveAnimation />
        <span class="seeNum">在线人数: {{ liveInfo.online_num}}</span>
    </div>
    <span class="liveBack" v-if="liveInfo.transcribe===1">回放</span>
    <u-image class="coverImg" :src="liveInfo.cover" width="100%" height="420"  :lazy-load="true" :fade="true">
      <u-loading slot="loading"></u-loading>
    </u-image>
    <u-image class="shopImg" :src="liveInfo.shop_logo"  :lazy-load="true" :fade="true" width="80" height="80"  border-radius="100"></u-image>
    <div class="bottom">
        <h2 class="title">{{liveInfo.shop_name}}</h2>
        <p class="tip">{{liveInfo.title}}</p>
    </div>
</div>
</template>

<script>
export default {
    name: 'liveCard',
    data() {
        return {

        }
    },
    props: {
        liveInfo: {
            type: Object,
            required: true,
            default: {}
        }
    },
    methods: {
        linkTo(item) {
            const params = {shop_id:item.shop_id}
            // #ifdef APP-PLUS
             this.$u.route({url:'/pages/live/Audience',params})
            // #endif
            // #ifdef  MP-WEIXIN || H5
            this.$u.route({url:'/platforms/live-player',params})
            // #endif
        },
    }
}
</script>

<style lang="scss" scoped>
@import '@/static/css/mixins.scss';

.liveCard {
    background: #fff;
    border-radius: 12upx;
    position: relative;
    flex-basis: 356upx;
    border-radius: 20upx;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 18upx;
    box-shadow: 0 8upx 40upx #e3e8ea;
    padding-bottom: 16upx;

    .coverImg {
        width: 100%;
        height: 360upx;
    }

    .shopImg {
        width: 80upx;
        height: 80upx;
        border-radius: 200px;
        position: absolute;
        left: 50%;
        top: 360upx;
        transform: translateX(-50%);

    }

    .bottom {
        text-align: center;
        margin-top: 26upx;
        padding: 0 12upx;

        .title {
            font-size: 30upx;
            font-weight: 400;
            @extend .textEllipsis;
        }

        .tip {
            @extend .textEllipsis;
            line-height: 1;
            font-size: 24upx;
            color: #fa3f3f;
            height: 24upx;
        }
    }
}

.liveBack {
    background-color: rgba(0, 0, 0, 0.6);
    top: 10upx;
    right: 10upx;
    position: absolute;
    font-size: 24upx;
    color: #fff;
    border-radius: 100px;
    display: inline-block;
    padding: 0 14upx;
    line-height: 1.4;
  z-index: 10;
}
</style>
